﻿elector_voting_pattern_circumstances_kurultai_elective_modifier = {
	##########################	Elector voting patterns (circumstances)	##########################
	#Sexism
	modifier = { #Gender weights
		desc = tooltip_feudal_elector_vote_agnatic_woman
		OR = {
			scope:title = { #Title might have different law than realm's.
				has_title_law = male_preference_law
			}
			AND = { #If title has neither the required law nor its opposites, check for realm law.
				scope:holder = { has_realm_law = male_preference_law }
				scope:title = {
					NOR = {
						has_title_law = female_preference_law
						has_title_law = equal_law
					}
				}
			}
			faith = { has_doctrine = doctrine_gender_male_dominated }
		}
		scope:candidate = { is_female = yes }
		add = {
			subtract = 100
			if = { #Increase if both.
				limit = {
					OR = {
						scope:title = { #Title might have different law than realm's.
							has_title_law = male_preference_law
						}
						AND = { #If title has neither the required law nor its opposites, check for realm law.
							scope:holder = { has_realm_law = male_preference_law }
							scope:title = {
								NOR = {
									has_title_law = female_preference_law
									has_title_law = equal_law
								}
							}
						}
					}
					faith = { has_doctrine = doctrine_gender_male_dominated }
				}
				multiply = 1.5
			}
			if = { #Halve if talking about myself.
				limit = {
					this = scope:candidate
					scope:candidate = scope:holder_candidate
				}
				multiply = 0.5
			}
		}
	}
	modifier = { #Gender weights
		desc = tooltip_feudal_elector_vote_enatic_man
		OR = {
			scope:title = { #Title might have different law than realm's.
				has_title_law = female_preference_law
			}
			AND = { #If title has neither the required law nor its opposites, check for realm law.
				scope:holder = { has_realm_law = female_preference_law }
				scope:title = {
					NOR = {
						has_title_law = male_preference_law
						has_title_law = equal_law
					}
				}
			}
			faith = { has_doctrine = doctrine_gender_female_dominated }
		}
		scope:candidate = {
			is_female = no
		}
		add = {
			subtract = 100
			if = { #Increase if both.
				limit = {
					OR = {
						scope:title = { #Title might have different law than realm's.
							has_title_law = female_preference_law
						}
						AND = { #If title has neither the required law nor its opposites, check for realm law.
							scope:holder = { has_realm_law = female_preference_law }
							scope:title = {
								NOR = {
									has_title_law = male_preference_law
									has_title_law = equal_law
								}
							}
						}
					}
					faith = { has_doctrine = doctrine_gender_female_dominated }
				}
				multiply = 1.5
			}
			if = { #Halve if talking about myself.
				limit = {
					this = scope:candidate
					scope:candidate = scope:holder_candidate
				}
				multiply = 0.5
			}
		}
	}
	#Ageism
	modifier = {
		add = -30
		desc = tooltip_feudal_elector_vote_baby
		NOT = { this = scope:candidate }
		scope:candidate = {
			age < 5
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_child
		NOT = { this = scope:candidate }
		scope:candidate = {
			age > 5
			age < 16
		}
		add = {
			subtract = 10
			if = {
				limit = {
					age < 10
				}
				subtract = 15
			}
		}
	}
	modifier = { #Still too young for older rulers
		add = -10
		desc = tooltip_feudal_elector_vote_youngster
		NOT = { this = scope:candidate }
		age > 40
		scope:candidate = {
			age > 16
			age < 25
		}
	}
	modifier = { #Or too old for younger rulers.
		add = -10
		desc = tooltip_feudal_elector_vote_oldtimer
		NOT = { this = scope:candidate }
		age < 30
		scope:candidate = {
			age > 40
			age < 50
		}
	}
	modifier = { #Or simply too old overall.
		add = -15
		desc = tooltip_feudal_elector_vote_decrepit
		NOT = { this = scope:candidate }
		scope:candidate = { age > 50 }
	}
	#Culturism
	modifier = {
		desc = tooltip_feudal_elector_vote_fellow_culture
		NOT = { this = scope:candidate }
		root.culture = scope:candidate.culture
		add = 20
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_stranger
		scope:holder.culture = root.culture #Only a concern if Elector and current ruler share culture.
		NOT = { root.culture = scope:candidate.culture }
		culture = { has_same_culture_heritage = scope:candidate.culture }
		NOT = { is_close_family_of = scope:candidate }
		add = {
			subtract = 30
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_foreigner
		scope:holder.culture = root.culture #Only a concern if Elector and current ruler share culture.
		NOT = { culture = { has_same_culture_heritage = scope:candidate.culture } }
		NOT = { is_close_family_of = scope:candidate }
		add = {
			subtract = 60
		}
	}
	modifier = { #Candidate is a foreigner's pet
		desc = tooltip_feudal_elector_vote_strangers_pet
		scope:candidate = {
			this = scope:holder_candidate
			NOT = { this.culture = root.culture }
			culture = { has_same_culture_heritage = root.culture }
			this.culture = scope:holder.culture
		}
		NOT = { is_close_family_of = scope:candidate }
		add = {
			subtract = 20
		}
	}
	modifier = { #Candidate is a foreigner's pet
		desc = tooltip_feudal_elector_vote_foreigners_pet
		scope:candidate = {
			this = scope:holder_candidate
			NOT = { culture = { has_same_culture_heritage = root.culture } }
			this.culture = scope:holder.culture
		}
		NOT = { is_close_family_of = scope:candidate }
		add = {
			subtract = 30
		}
	}
	#Faithism
	modifier = { #Accepted but different faith. (Buddhism vs Hinduism)
		desc = tooltip_feudal_elector_vote_different_faith
		NOT = { root.faith = scope:candidate.faith }
		ai_zeal >= 0 #Does not care otherwise.
		faith = {
			faith_hostility_level = {
				target = scope:candidate.faith
				value = faith_fully_accepted_level
			}
		}
		add = {
			subtract = 25
		}
	}
	modifier = { #Astray (Catholic vs Orthodox)
		desc = tooltip_feudal_elector_vote_astray
		NOT = { root.faith = scope:candidate.faith }
		faith = {
			faith_hostility_level = {
				target = scope:candidate.faith
				value = faith_astray_level
			}
		}
		add = {
			subtract = 50
		}
	}
	modifier = { #Heretic (Catholic vs Cathar)
		desc = tooltip_feudal_elector_vote_heretic
		add = {
			subtract = 100
			if = { #Further increased by AI zeal.
				limit = {
					ai_zeal >= low_positive_zeal
				}
				subtract = 50
			}
			if = { #Further increased by AI zeal.
				limit = {
					ai_zeal >= medium_positive_zeal
				}
				subtract = 50
			}
			if = { #Further increased by AI zeal.
				limit = {
					ai_zeal >= high_positive_zeal
				}
				subtract = 50
			}
		}
		NOT = { root.faith = scope:candidate.faith }
		faith = {
			faith_hostility_level = {
				target = scope:candidate.faith
				value = faith_hostile_level
			}
		}
	}
	modifier = { #Infidel (Catholic vs Ashari)
		desc = tooltip_feudal_elector_vote_evil_heathen
		add = {
			subtract = 200
			if = { #Further increased by AI zeal.
				limit = {
					ai_zeal >= low_positive_zeal
				}
				subtract = 75
			}
			if = { #Further increased by AI zeal.
				limit = {
					ai_zeal >= medium_positive_zeal
				}
				subtract = 75
			}
			if = { #Further increased by AI zeal.
				limit = {
					ai_zeal >= high_positive_zeal
				}
				subtract = 75
			}
		}
		NOT = { root.faith = scope:candidate.faith }
		faith = {
			faith_hostility_level = {
				target = scope:candidate.faith
				value = faith_evil_level
			}
		}
	}

	#Barbarism
	modifier = {
		add = -15
		desc = tooltip_feudal_elector_vote_uncivilized
		OR = {
			government_has_flag = government_is_feudal
			has_government = republic_government
		}
		scope:candidate = {
			OR = {
				government_has_flag = government_is_clan
				government_has_flag = government_is_tribal
			}
		}
	}
	modifier = {
		add = -15
		desc = tooltip_feudal_elector_vote_settled
		government_has_flag = government_is_clan
		scope:candidate = {
			NOT = { government_has_flag = government_is_clan }
		}
	}
	#Nepotism
	modifier = {
		add = 10
		desc = tooltip_feudal_elector_vote_dynasty
		NOT = { this = scope:candidate }
		exists = root.dynasty
		exists = scope:candidate.dynasty
		root.dynasty = scope:candidate.dynasty
		scope:candidate = {
			NOT = { is_close_family_of = root }
		}
	}
	modifier = {
		add = 20
		desc = tooltip_feudal_elector_vote_relative
		NOT = { this = scope:candidate }
		scope:candidate = {
			is_close_family_of = root
			NOT = { is_child_of = root }
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_parent
		NOT = { this = scope:candidate }
		scope:candidate = { is_child_of = root }
		add = {
			value = 30
			if = { #Current Ruler should tend to often pick one of his own children as potential heirs.
				limit = { this = scope:holder }
				add = 30
			}
		}
	}
	modifier = { #Elector AI should not pick current ruler's distant relatives
		add = -75
		desc = tooltip_feudal_elector_vote_distant_relative
		NOR = {
			this = scope:candidate
			is_close_family_of = root
			scope:candidate = scope:holder_candidate #Avoid if he's being specifically picked by the current ruler.
		}
		exists = scope:candidate.dynasty
		exists = scope:holder.dynasty
		scope:candidate = { #Candidate in question must not be of the same house as the Elector.
			dynasty = scope:holder.dynasty
			NOT = {
				house = root.house
			}
		}
	}
	#Educational preferences
	modifier = { # Warrior society prefers warriors
		desc = tooltip_feudal_elector_vote_martial_education
		this_is_martial_society_trigger = yes
		scope:candidate = {
			martial >= 10
			OR = {
				has_trait = education_martial
				has_lifestyle = martial_lifestyle
				has_trait = lifestyle_blademaster
				has_martial_lifestyle_trait_trigger = yes
			}
		}
		add = 30
	}
	#Claims
	modifier = {
		add = 30
		desc = tooltip_feudal_elector_vote_strong_claimant
		NOT = { this = scope:candidate }
		scope:candidate = { has_claim_on = scope:title }
	}
	modifier = {
		add = 15
		desc = tooltip_feudal_elector_vote_weak_claimant
		NOT = { this = scope:candidate }
		scope:candidate = { has_weak_claim_on = scope:title }
	}
}
elector_voting_pattern_traits_kurultai_elective_modifier = {
	##########################	Elector voting patterns (traits)	##########################
	#Personality Traits compatibility
	#Sins vs Virtues
	#Crime traits
	#Attraction
	#Special cases (ex. deformities, disfigured for Byzantines)

	#Trait compatibility between elector and candidate
	compatibility_modifier = {
		who = root
		compatibility_target = scope:candidate
		min = -50
		max = 50
		trigger = {
			NOT = { root = scope:candidate }
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_sinful
		NOT = { this = scope:candidate } #Do not judge yourself.
		NOT = { has_trait = cynical }
		ai_zeal > 0
		scope:candidate = { num_sinful_traits >= 1 }
		add = {
			subtract = 5
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_sinful_traits >= 2 }
				}
				subtract = 5
			}
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_sinful_traits >= 3 }
				}
				subtract = 5
			}
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_sinful_traits >= 4 }
				}
				subtract = 5
			}
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_sinful_traits >= 5 }
				}
				subtract = 5
			}
			multiply = ai_zeal #...Multiply by Elector Zeal.
			multiply = 0.1 #Reduce overall to avoid extreme numbers.
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_virtuous
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			has_trait = cynical
		}
		ai_zeal > 0
		scope:candidate = { num_virtuous_traits >= 1 }
		add = {
			add = 5
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_virtuous_traits >= 2 }
				}
				add = 5
			}
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_virtuous_traits >= 3 }
				}
				add = 5
			}
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_virtuous_traits >= 4 }
				}
				add = 5
			}
			if = { #Check specific number...
				limit = {
					scope:candidate = { num_virtuous_traits >= 5 }
				}
				add = 5
			}
			multiply = ai_zeal #...Multiply by Elector Zeal.
			multiply = 0.1 #Reduce overall to avoid extreme numbers.
		}
	}
	#Excommunication
	modifier = {
		desc = tooltip_feudal_elector_vote_excommunication
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = { has_doctrine_parameter = excommunication_active }
		faith = scope:candidate.faith
		root.faith.religious_head = scope:candidate.faith.religious_head #Must have been excommunicated by the same Pope.
		OR = {
			NOT = { has_trait = excommunicated }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = excommunicated }
		add = {
			subtract = 25
			if = { #Religious gradients.
				limit = { ai_zeal > 0 }
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Illegitimate children (excepting the children of consorts, which filter separately)
	modifier = {
		desc = tooltip_feudal_elector_vote_out_of_wedlock
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_bastardry_none }
		}
		OR = {
			NOR = {
				has_trait = bastard
				has_trait = legitimized_bastard
				has_trait = wild_oat
			}
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = {
			OR = {
				has_trait = bastard
				has_trait = legitimized_bastard
				has_trait = wild_oat
			}
		}
		add = {
			subtract = 15
			if = { #Religious gradients.
				limit = {
					faith = { has_doctrine = doctrine_bastardry_legitimization }
				}
				subtract = 10
			}
			if = { #Religious gradients.
				limit = {
					faith = { has_doctrine = doctrine_bastardry_all }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = {
					ai_zeal > 10
				}
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Children of Consorts
	modifier = {
		desc = tooltip_feudal_elector_vote_out_of_wedlock
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			allowed_concubines = yes
			faith = { has_doctrine = doctrine_bastardry_none } #Unlikely to be fussed about such kids
		}
		OR = {
			NOT = { has_trait = child_of_concubine }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = child_of_concubine }
		add = {
			subtract = 15
			if = { #Religious gradients.
				limit = {
					faith = { has_doctrine = doctrine_bastardry_legitimization }
				}
				subtract = 10
			}
			if = { #Religious gradients.
				limit = {
					faith = { has_doctrine = doctrine_bastardry_all }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = {
					ai_zeal > 10
				}
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Sodomy Crime
	modifier = {
		desc = tooltip_feudal_elector_vote_sodomite
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_homosexuality_accepted }
		}
		ai_zeal > 0
		OR = {
			NOT = { has_trait = sodomite }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = sodomite }
		add = {
			subtract = 15
			if = { #Religious gradients.
				limit = {
					faith = { has_doctrine = doctrine_homosexuality_shunned }
				}
				subtract = 10
			}
			else_if = { #Religious gradients.
				limit = {
					faith = { has_doctrine = doctrine_homosexuality_crime }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = {
					ai_zeal > 10
				}
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Kinslayer Crime
	modifier = {
		desc = tooltip_feudal_elector_vote_kinslayer
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_kinslaying_accepted }
		}
		OR = {
			NOT = { has_trait = kinslayer }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = kinslayer }
		add = {
			value = 0
			if = { #Check specific trait, multiply depending on religious doctrine.
				limit = {
					scope:candidate = { has_trait = kinslayer_1 }
				}
				subtract = 10
				if = {
					limit = {
						faith = { has_doctrine = doctrine_kinslaying_any_dynasty_member_crime }
					}
					multiply = 2
				}
			}
			else_if = {
				limit = {
					scope:candidate = { has_trait = kinslayer_2 }
				}
				subtract = 15
				if = {
					limit = {
						faith = {
							OR = {
								has_doctrine = doctrine_kinslaying_any_dynasty_member_crime
								has_doctrine = doctrine_kinslaying_extended_family_crime
							}
						}
					}
					multiply = 2
				}
			}
			else_if = {
				limit = {
					scope:candidate = { has_trait = kinslayer_3 }
				}
				subtract = 20
				if = {
					limit = {
						faith = {
							OR = {
								has_doctrine = doctrine_kinslaying_any_dynasty_member_crime
								has_doctrine = doctrine_kinslaying_extended_family_crime
								has_doctrine = doctrine_kinslaying_close_kin_crime
							}
						}
					}
					multiply = 2
				}
			}
			#And further add malus depending on Elector's relation to the Kinslaying candidate.
			if = {
				limit = {
					exists = scope:candidate.dynasty
					NOT = { dynasty = scope:candidate.dynasty }
				}
				subtract = 10
			}
			else_if = {
				limit = {
					exists = scope:candidate.dynasty
					dynasty = scope:candidate.dynasty
					NOT = { is_close_family_of = scope:candidate }
				}
				subtract = 20
			}
			else_if = {
				limit = {
					exists = scope:candidate.dynasty
					dynasty = scope:candidate.dynasty
					is_close_family_of = scope:candidate
				}
				subtract = 30
			}
			if = { #Boost for Scandinavian Elective.
				limit = {
					scope:title = { has_title_law = kurultai_elective_succession_law }
				}
				multiply = 1.5
			}
		}
	}

	#Deviancy
	modifier = {
		desc = tooltip_feudal_elector_vote_deviant
		NOT = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_deviancy_accepted }
		}
		OR = {
			NOT = { has_trait = deviant }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = deviant }
		add = {
			subtract = 15
			if = {
				limit = {
					faith = { has_doctrine = doctrine_deviancy_shunned }
				}
				subtract = 10
			}
			if = {
				limit = {
					faith = { has_doctrine = doctrine_deviancy_crime }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = { ai_zeal > 10 }
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Cannibalism
	modifier = {
		desc = tooltip_feudal_elector_vote_cannibal
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine_parameter = cannibalism_legal }
		}
		OR = {
			NOT = { has_trait = cannibal }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = cannibal }
		add = {
			subtract = 30
			if = { #Religious gradients.
				limit = { ai_zeal > 10 }
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Incest
	modifier = {
		desc = tooltip_feudal_elector_vote_incestuous
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_consanguinity_unrestricted }
		}
		OR = {
			NOT = { has_trait = incestuous }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = { has_trait = incestuous }
		add = {
			subtract = 25
			if = { #Religious gradients.
				limit = { ai_zeal > 10 }
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Adultery - males
	modifier = {
		desc = tooltip_feudal_elector_vote_adulterous_man
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_adultery_men_accepted }
		}
		OR = {
			NOT = { has_trait = adulterer }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = {
			has_trait = adulterer
			is_female = no
		}
		add = {
			subtract = 15
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_men_shunned }
				}
				subtract = 10
			}
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_men_crime }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = { ai_zeal > 10 }
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Adultery - females
	modifier = {
		desc = tooltip_feudal_elector_vote_adulterous_woman
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine = doctrine_adultery_women_accepted }
		}
		OR = {
			NOT = { has_trait = adulterer }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = {
			has_trait = adulterer
			is_female = yes
		}
		add = {
			subtract = 15
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_women_shunned }
				}
				subtract = 10
			}
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_women_crime }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = { ai_zeal > 10 }
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Fornication - males
	modifier = {
		desc = tooltip_feudal_elector_vote_fornicating_man
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = { has_doctrine = doctrine_adultery_men_accepted }
		OR = {
			NOT = { has_trait = fornicator }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = {
			has_trait = fornicator
			is_female = no
		}
		add = {
			subtract = 15
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_men_shunned }
				}
				subtract = 10
			}
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_men_crime }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = {
					ai_zeal > 10
				}
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Fornication - females
	modifier = {
		desc = tooltip_feudal_elector_vote_fornicating_woman
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = { has_doctrine = doctrine_adultery_women_accepted }
		OR = {
			NOT = { has_trait = fornicator }
			has_trait = arbitrary #No need for consistency
		}
		scope:candidate = {
			has_trait = fornicator
			is_female = yes
		}
		add = {
			subtract = 15
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_women_shunned }
				}
				subtract = 10
			}
			if = {
				limit = {
					faith = { has_doctrine = doctrine_adultery_women_crime }
				}
				subtract = 15
			}
			if = { #Religious gradients.
				limit = {
					ai_zeal > 10
				}
				subtract = {
					value = ai_zeal
					multiply = 0.5
				}
			}
		}
	}
	#Attraction
	modifier = {
		desc = tooltip_feudal_elector_vote_attractive
		NOT = { this = scope:candidate } #Do not judge yourself, you dirty AI.
		is_adult = yes
		scope:candidate = {
			is_adult = yes
			attraction >= 25
		}
		add = {
			value = 1
			multiply = scope:candidate.attraction
			multiply = 0.1
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_ugly
		NOT = { this = scope:candidate } #Do not judge yourself.
		is_adult = yes
		scope:candidate = {
			is_adult = yes
			attraction <= -25
		}
		add = {
			value = 0
			multiply = scope:candidate.attraction
			multiply = 0.1
		}
	}

	#Special cases (ex. deformities, disfigured for Byzantines)
	modifier = {
		add = -35
		desc = tooltip_feudal_elector_vote_incapable
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = incapable }
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_incapable_warrior
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = incapable }
		add = {
			subtract = 100
		}
	}
	modifier = {
		add = -15
		desc = tooltip_feudal_elector_vote_infirm
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_diplomatic_society_trigger = no
		scope:candidate = { has_trait = infirm }
	}
	modifier = {
		add = -30
		desc = tooltip_feudal_elector_vote_infirm_diplomat
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_diplomatic_society_trigger = yes
		scope:candidate = { has_trait = infirm }
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_disfigured
		this_is_martial_society_trigger = no
		NOT = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
		scope:candidate = { has_trait = disfigured }
		add = -15
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_disfigured_byzantine
		culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance }
		scope:candidate = { has_trait = disfigured }
		add = -100
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_disfigured_warrior
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = disfigured }
		add = {
			subtract = 10
		}
	}
	modifier = {
		add = -10
		desc = tooltip_feudal_elector_vote_maimed
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = maimed }
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_maimed_warrior
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = maimed }
		add = {
			subtract = 30
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_born_in_the_purple
		NOT = { this = scope:candidate } #Do not judge yourself.
		culture = { has_cultural_parameter = children_can_be_born_in_the_purple }
		scope:candidate = { has_trait = born_in_the_purple }
		add = 50
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_genius_diplomat
		NOT = { this = scope:candidate } #Do not judge yourself.
		OR = {
			this_is_diplomatic_society_trigger = yes
			this_is_spiritual_society_trigger = yes
		}
		scope:candidate = {
			OR = {
				has_trait = intellect_good
				has_trait = shrewd
			}
		}
		add = {
			value = 10
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_good_1 }
				}
				add = 5
			}
			if = {
				limit = {
					scope:candidate = {
						OR = {
							has_trait = intellect_good_2
							has_trait = shrewd
						}
					}
				}
				add = 10
			}
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_good_3 }
				}
				add = 15
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_genius
		NOT = { this = scope:candidate } #Do not judge yourself.
		NOR = {
			this_is_diplomatic_society_trigger = yes
			this_is_spiritual_society_trigger = yes
		}
		scope:candidate = {
			OR = {
				has_trait = intellect_good
				has_trait = shrewd
			}
		}
		add = {
			value = 0
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_good_1 }
				}
				add = 5
			}
			if = {
				limit = {
					scope:candidate = {
						OR = {
							has_trait = intellect_good_2
							has_trait = shrewd
						}
					}
				}
				add = 10
			}
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_good_3 }
				}
				add = 15
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_strong
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = {
			OR = {
				has_trait = physique_good
				has_trait = strong
			}
		}
		add = {
			value = 0
			if = {
				limit = {
					scope:candidate = { has_trait = physique_good_1 }
				}
				add = 5
			}
			if = {
				limit = {
					scope:candidate = {
						OR = {
							has_trait = strong
							has_trait = physique_good_2
						}
					}
				}
				add = 10
			}
			if = {
				limit = {
					scope:candidate = { has_trait = physique_good_3 }
				}
				add = 15
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_strong_warrior
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = {
			OR = {
				has_trait = physique_good
				has_trait = strong
			}
		}
		add = {
			value = 10
			if = {
				limit = {
					scope:candidate = { has_trait = physique_good_1 }
				}
				add = 5
			}
			if = {
				limit = {
					scope:candidate = {
						OR = {
							has_trait = strong
							has_trait = physique_good_2
						}
					}
				}
				add = 10
			}
			if = {
				limit = {
					scope:candidate = { has_trait = physique_good_3 }
				}
				add = 15
			}
			if = { #Scandinavian elective more unforgiving.
				limit = {
					scope:title = { has_title_law = kurultai_elective_succession_law }
				}
				multiply = 2
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_imbecile
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_diplomatic_society_trigger = no
		scope:candidate = {
			OR = {
				has_trait = intellect_bad
				has_trait = dull
			}
		}
		add = {
			value = 0
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_bad_1 }
				}
				subtract = 5
			}
			if = {
				limit = {
					scope:candidate = {
						OR = {
							has_trait = intellect_bad_2
							has_trait = dull
						}
					}
				}
				subtract = 10
			}
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_bad_3 }
				}
				subtract = 15
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_imbecile_diplomat
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_diplomatic_society_trigger = yes
		scope:candidate = {
			OR = {
				has_trait = intellect_bad
				has_trait = dull
			}
		}
		add = {
			subtract = 10
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_bad_1 }
				}
				subtract = 5
			}
			if = {
				limit = {
					scope:candidate = {
						OR = {
							has_trait = intellect_bad_2
							has_trait = dull
						}
					}
				}
				subtract = 10
			}
			if = {
				limit = {
					scope:candidate = { has_trait = intellect_bad_3 }
				}
				subtract = 15
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_clubfooted
		NOT = { this = scope:candidate } #Do not judge yourself.
		scope:candidate = { has_trait = clubfooted }
		add = {
			subtract = 5
			if = {
				limit = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
				subtract = 10
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_dwarf
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = dwarf }
		add = {
			subtract = 15
			if = {
				limit = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
				subtract = 20
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_dwarf_warrior
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = dwarf }
		add = {
			subtract = 60
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_hunchback
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = {has_trait = hunchbacked }
		add = {
			subtract = 15
			if = {
				limit = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
				subtract = 30
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_hunchback_warrior
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = hunchbacked }
		add = {
			subtract = 60
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_inbred
		NOT = { this = scope:candidate } #Do not judge yourself.
		scope:candidate = {
			OR = {
				has_trait = inbred
				has_trait = spindly
				has_trait = scaly
				has_trait = albino
				has_trait = wheezing
				has_trait = bleeder
			}
		}
		add = {
			subtract = 15
			if = {
				limit = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
				subtract = 60
			}
		}
	}
	modifier = {
		desc = tooltip_feudal_elector_vote_lisping
		NOT = { this = scope:candidate } #Do not judge yourself.
		scope:candidate = { has_trait = lisping }
		add = {
			subtract = 5
			if = {
				limit = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
				subtract = 10
			}
		}
	}
	modifier = {
		add = -5
		desc = tooltip_feudal_elector_vote_stuttering
		NOT = { this = scope:candidate } #Do not judge yourself.
		scope:candidate = { has_trait = stuttering }
	}
	modifier = { #Shunned for being Evil
		add = -25
		desc = tooltip_feudal_elector_vote_evil_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		OR = {
			has_trait = arbitrary #No need for consistency
			NOT = { has_personality_malicious_trigger = yes }
		}
		scope:candidate = { has_personality_malicious_trigger = yes }
	}
	modifier = { #Shunned for being a lunatic
		add = -15
		desc = tooltip_feudal_elector_vote_lunatic_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		OR = {
			has_trait = arbitrary #No need for consistency
			NOR = {
				has_trait = lunatic
				has_trait = possessed
			}
		}
		scope:candidate = { has_trait = lunatic }
	}
	modifier = { #Shunned for being possessed
		add = -15
		desc = tooltip_feudal_elector_vote_possessed_negative
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = { has_doctrine_parameter = spirit_possession_active }
		}
		OR = {
			has_trait = arbitrary #No need for consistency
			NOR = {
				has_trait = lunatic
				has_trait = possessed
			}
		}
		scope:candidate = { has_trait = possessed }
	}
	modifier = { #Praised for being possessed
		add = 35
		desc = tooltip_feudal_elector_vote_possessed_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = { has_doctrine_parameter = spirit_possession_active }
		ai_zeal > 10
		scope:candidate = { has_trait = possessed }
	}
	modifier = { #Praised for being Pilgrim
		add = 10
		desc = tooltip_feudal_elector_vote_pilgrim_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = scope:candidate.faith
		ai_zeal > 10
		scope:candidate = { has_trait = pilgrim }
	}
	modifier = { #Praised for being Crusader
		add = 10
		desc = tooltip_feudal_elector_vote_crusader_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = scope:candidate.faith
		ai_zeal > 10
		scope:candidate = { has_trait = faith_warrior }
	}
	modifier = { #Shunned for being Crusader
		add = -15
		desc = tooltip_feudal_elector_vote_crusader_negative
		NOR = {
			this = scope:candidate	#Do not judge yourself.
			faith = scope:candidate.faith
		}
		faith = {
			faith_hostility_level = {
				target = scope:candidate.faith
				value >= faith_hostile_level
			}
		}
		ai_zeal > 10
		scope:candidate = { has_trait = faith_warrior }
	}
	modifier = { #Praised for being a saoshyant_descendant
		add = 10
		desc = tooltip_feudal_elector_vote_saoshyant_descendant_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		faith = { religion_tag = zoroastrianism_religion }
		scope:candidate = { has_trait = saoshyant_descendant }
	}
	modifier = { #Praised for being Adventurer
		add = 10
		desc = tooltip_feudal_elector_vote_adventurer_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = adventurer }
	}
	modifier = { #Shunned for being Adventurer
		add = -10
		desc = tooltip_feudal_elector_vote_adventurer_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = adventurer }
	}
	modifier = { #Praised for being Berserker
		add = 5
		desc = tooltip_feudal_elector_vote_berserker_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = berserker }
	}
	modifier = { #Shunned for being Berserker
		add = -20
		desc = tooltip_feudal_elector_vote_berserker_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = berserker }
	}
	modifier = { #Shunned for being blind
		desc = tooltip_feudal_elector_vote_blinded_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = blind }
		add = {
			subtract = 10
			if = {
				limit = { culture = { has_cultural_parameter = physical_disfigurement_blocks_inheritance } }
				subtract = 140
			}
		}
	}
	modifier = { #Shunned for being blind
		desc = tooltip_feudal_elector_vote_blinded_negative_warrior
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = blind }
		add = {
			subtract = 40
		}
	}
	modifier = { #Shunned for being eunuch
		desc = tooltip_feudal_elector_vote_eunuch_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		NOR = {
			culture = { has_cultural_parameter = can_appoint_chief_eunuch }
			faith = { religion_tag = islam_religion }
		}
		scope:candidate = {has_trait = eunuch }
		add = -25
	}
	modifier = { #Shunned for being eunuch
		desc = tooltip_feudal_elector_vote_eunuch_negative_warrior
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		NOR = {
			culture = { has_cultural_parameter = can_appoint_chief_eunuch }
			faith = { religion_tag = islam_religion }
		}
		scope:candidate = {has_trait = eunuch }
		add = -50
	}
	modifier = { #Shunned for being eunuch
		desc = tooltip_feudal_elector_vote_eunuch_negative_byzantine
		NOT = { this = scope:candidate } #Do not judge yourself.
		OR = {
			culture = { has_cultural_parameter = can_appoint_chief_eunuch }
			faith = { religion_tag = islam_religion }
		}
		scope:candidate = { has_trait = eunuch }
		add = -150
	}
	modifier = { #Praised for being Giant
		add = 10
		desc = tooltip_feudal_elector_vote_giant_positive
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = yes
		scope:candidate = { has_trait = giant }
	}
	modifier = { #Shunned for being Giant
		add = -10
		desc = tooltip_feudal_elector_vote_giant_negative
		NOT = { this = scope:candidate } #Do not judge yourself.
		this_is_martial_society_trigger = no
		scope:candidate = { has_trait = giant }
	}
	modifier = { #Shunned for being unproved courtier in the shadow of the ruler.
		add = -10
		desc = tooltip_feudal_elector_vote_spoiled_courtier
		scope:candidate = { this = scope:holder_candidate }
		NOT = { this = scope:candidate } #Do not judge yourself.
		scope:candidate = {
			NOR = {
				is_ruler = yes
				has_council_position = councillor_marshal
				has_council_position = councillor_chancellor
				has_council_position = councillor_steward
				has_council_position = councillor_spymaster
				has_council_position = councillor_court_chaplain
			}
			OR = {
				has_trait = deviant
				has_trait = lazy
				has_trait = lifestyle_reveler
				has_trait = seducer
				has_trait = drunkard
				has_trait = shy
			}
		}
	}
}